from app import create_app, db
from sqlalchemy import inspect

app = create_app()

with app.app_context():
    inspector = inspect(db.engine)
    tables = inspector.get_table_names()
    
    print("数据库中的表:")
    for table in sorted(tables):
        print(f"- {table}")
    
    # 检查我们需要的表是否存在
    required_tables = [
        'matchmakers', 'matchmaking_records', 'light_records', 
        'membership_orders', 'commission_records', 'withdraw_records', 
        'user_share_records'
    ]
    
    missing_tables = [table for table in required_tables if table not in tables]
    
    if missing_tables:
        print("\n缺少的表:")
        for table in missing_tables:
            print(f"- {table}")
    else:
        print("\n所有必需的表都已创建!") 